/*
 * view.h
 *
 *  Created on: 10-dic-2008
 *      Author: igor
 */

#ifndef VIEW_H_
#define VIEW_H_

#include <Elementary.h>
#include "../enotes.h"

/* DATATYPE DEFINITIONS */
// TODO - sync with enotes.h
typedef struct
{
   Evas_Object *title;
   char *infos;
   char *duedate;
   char *categories[PATH_MAX];
   char *icon;
   Evas_Object *text;

} e_todoitem;

struct etodoitem
{
   e_todoitem inf;
   struct etodoitem *pun;
};

/* FUNCTIONS PROTOTIPE */
/* displays main window */
void my_win_main(void);
/* close main window cleanly */
void my_win_del(void *data, Evas_Object *obj, void *event_info);
/* close a single children window */
void my_win_close(void *data, Evas_Object *obj, void *event_info);
/* refresh main win by deleting and recreating that */
void my_entry_bt_refresh(void *data, Evas_Object *obj, void *event_info);
/* assign a layout (ly) named (key) to an object */
void window_swallow(Evas_Object *ly, const char *key, Evas_Object *object);

/* TODO - rename and documentation */
void my_entry_win_modify(void *data, Evas_Object *obj, void *event_info);
void my_win_modify_item(void *data, Evas_Object *obj, void *event_info);

/*
 * setup data for a new item: show a win with
 * a text box for the title and one for item
 * content, then a button to save note and
 * close the win
 */
void my_entry_bt_new_item(void *data, Evas_Object *obj, void *event_info);
/*
 * shows the window for the cancellation of an existing item,
 * it shows a list of button with the items in storage as title
 * clicking on the button it deletes the note.
 */
void my_entry_bt_delete(void *data, Evas_Object *obj, void *event_info);
/*
 * changes the displayed category
 */
void my_entry_bt_changecat(void *data, Evas_Object *obj, void *event_info);
/*
 * delete a category from a list, a cat to be deleted must be empty: it have
 * to contain zero or less items.
 *
 */
void my_entry_bt_deletecat(void *data, Evas_Object *obj, void *event_info);


#endif /* VIEW_H_ */
